package com.deli.jpa.repository;

import com.deli.jpa.entity.User;
import org.hibernate.annotations.NamedQuery;
import org.hibernate.annotations.SQLInsert;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

/**
 * @Description:
 * @Author: xudeli
 * @CreateDate: 2018/9/17 14:24
 **/
@Repository
public interface UserRepository extends JpaRepository<User,Integer> {

    @Query("select u from User u where u.id = :id")
    public User getUserById(@Param("id") Integer id);
}
